package com.hns.can.service.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hns.can.common.aop.orgTree.LeftOrgAnnotation;
import com.hns.can.common.constants.GlobalConst;
import com.hns.can.common.formula.FillCodeDscValue;
import com.hns.can.common.formula.FillParamsVo;
import com.hns.can.common.vo.CommonParamsVo;
import com.hns.can.service.vo.ElectronicSignsCountVo;
import com.hns.frame.mybatis.Pagination;
import com.hns.frame.service.CommonService;
import com.hns.tool.pub.PubUtil;

/**
 * 电子站牌service
 * @author:zhangy
 * @email:zhangyu2222z@sina.cn
 * @version Revision 2.0.0
 */
@Service
public class ElectronicSignsService extends CommonService {
	
	@Autowired
	private FillCodeDscValue fillCodeDscValue;

	/**
	 * 电子路牌统计
	 * @param params
	 * @return
	 * @throws Exception
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	@Transactional
	@LeftOrgAnnotation()
	public List getElectronicSignCountData(CommonParamsVo params) throws Exception{
		List list = PubUtil.convertListMapToObject(this.sqlMapDao.selectList("electronicSigns.getElectronicSignCountData", params), ElectronicSignsCountVo.class);
		HashMap map = new HashMap();
		map.put("licPltNo", GlobalConst.DEFAULT_CACHE_VALUE);
		FillParamsVo vo = new FillParamsVo("carId", map);
		fillCodeDscValue.fillInfoValue(list, new String[]{GlobalConst.CACHE_KEY_BASE_CAR_INFO}, vo);
		return list;
	}

	/**
	 * 电子路牌明细
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@Transactional
	public Pagination getElectronicSignDetail(CommonParamsVo params) throws Exception {
		Pagination page = this.myBatisPage("electronicSigns.getElectronicSignDetailCnt", "electronicSigns.getElectronicSignDetailData", params, ElectronicSignsCountVo.class);
		return page;
	}

	
	
}
